Programs written in Java programming language (Java is a trademark of Sun Microsystems Inc.) are generally run in a virtual machine environment, rather than directly on hardware. A virtual machine is a software-based computer that, like a physical computer, runs an operating system and applications. The virtual machine is comprised of a set of specification and configuration files and is backed by the physical resources of a host or platform. A Java program is typically compiled into byte-code form, and then interpreted by a Java Virtual Machine (JVM) into hardware commands for the platform on which the JVM is executing. The JVM itself is an application running on an underlying operating system of the platform. One advantage of this approach is that Java applications can run on any of a very wide variety of platforms.
Java is an object-oriented language. A Java program is formed from a set of class files having methods that represent sequences of instructions. These sequences of instructions are somewhat akin to subroutines. A hierarchy of classes can be defined, with each class inheriting properties (including methods) from those classes which are above it in the hierarchy. For any given class in the hierarchy, its descendants below it are called subclasses, while its ancestors above it are called superclasses. At run-time of an application, objects are created as instantiations of these class files, and the class files themselves are effectively loaded as objects. One Java object can call a method in another Java object.
JVMs utilize many internal buffers that grow dynamically during application execution. Growing these internal buffers can lead to repeated library function calls which adversely affect performance and cause a fragmentation of memory. For example, malloc is a library function that is used to allocate a block of memory on an internal buffer called a heap. The application accesses this block of memory via a pointer that is returned by the malloc call. The heap is an area of pre-reserved computer main storage (memory) that a program process can use to store data in some variable amount that will not be known until the program is running. The internal buffers utilized by the JVM start out small and are expanded on demand. A first execution of the application expands the internal buffers to a first maximum value. Then, if the application is executed again, the internal buffers will grow from their initial values to a second maximum value that equals the first maximum value. The internal buffer expansion occurs every time that the application is executed, resulting in inefficiencies.